Ambient (surrounding) conditions can affect the performance of both light and sound sensors. Therefore, it is important to calibrate these sensors for a particular environment so that they perform in an optimal way.
For instance, in a very bright room, an un-calibrated light sensor might deliver only high readings, reducing its potential performance. If you created your program in a dimmer location, your robot might react in an unusual ways when it is moved under more intense light. Calibrating the light sensor will allow it to read values over its full range under different conditions.
There are two ways to calibrate light and sound sensors using the MINDSTORMS NXT software. The first is to use the Calibrate Sensors function from the Tools menu. Using this function, you can calibrate a light or sound sensor just once per location (and not every time your program runs). For instance, if you attend a First LEGO League competition with brightly lighted competition tables, you can calibrate your light sensor just once on a table and not have to worry about calibrating each time you run your program.
The second option for calibration involves using several Calibration blocks in your program. Each time you run your program, these blocks will calibrate the sensors for current conditions. (See the Calibration block Help entry.)
To use this function, first make sure that your NXT is connected to your computer and that it is turned on. Also, make sure that the sensors you want to calibrate are connected to the NXT. Pay particular attention to the ports they are connected to.
When you are ready, select the Calibrate Sensors function from the Tools menu. The Calibrate Sensors dialog box will appear. If no NXT is connected to your computer, the dialog box will appear grayed out.
Select the light sensor and the port the sensor is connected to. Then click the Calibrate button. This will download a small program to the NXT and run it automatically.
On the NXTs screen you will see text that reads "Min Value:". Point the light sensor towards a material or spot that represents what the light sensor should measure as dark. Press the orange Enter button on the NXT.
Next you will see text that reads "Max Value:". Point the light sensor towards a material or spot that represents the brightest location the sensor will encounter during the program. Press the orange Enter button again. Calibration is complete.
Select the sound sensor and the port the sensor is connected to. Then click the Calibrate button. This will download a small program to the NXT and run it automatically.
On the NXTs screen you will see text that reads "Min Value:". Position the sound sensor in the environment it will encounter when the program is running and where any background noise is measurable. Press the orange Select button on the NXT.
Next you will see text that reads "Select Max:". Measure or make the loudest sound you want to measure and press the Select button again. Calibration is complete.
To learn more about the different sensors’ abilities and measurements please see the NXT Technology chapter in the printed User Guide that came with your MINDSTORMS NXT product.
Note: Calibration values set using the Calibrate Sensors function can be overwritten by Calibration blocks in a program, and vice versa. The most recent calibration event will take precedence. The calibration will stay in effect until you deliberately change the values or and reset them (see below).
Note: The calibration will work for the specific sensor no matter which port you connect it to after completing the calibration process. If you calibrate the light sensor on port 3, the calibration will still remain in effect if you later connect the light sensor to port 4.
If you want to start over and restore the factory default calibration values, follow the instructions below.
First, turn on the NXT and connect it to your computer.
Select the Calibrate Sensors item from the Tools menu. The Calibrate Sensors dialog box will appear. If no NXT is connected, the dialog box will appear grayed out.
Select the sensor you want to restore to factory default settings and click Default.